package services

import "mishop/models"

type IAreaService interface {
	FindByID(product_id int) (*models.Area, error)
	FindByParentID(page, rows int, parent_id int) (*models.Pages, error)
	FindAllByParentID(parent_id int) (*models.Pages, error)
}
type AreaService struct {
	model models.IArea
}

func (p *AreaService) FindByID(product_id int) (*models.Area, error) {
	return p.model.FindByID(product_id)
}

func (p *AreaService) FindAllByParentID(parent_id int) (*models.Pages, error) {
	return p.model.FindAllByParentID(parent_id)
}
func (p *AreaService) FindByParentID(page, rows int, parent_id int) (*models.Pages, error) {
	return p.model.FindByParentID(page, rows, parent_id)
}
func NewAreaService(model models.IArea) IAreaService {
	return &AreaService{model: model}
}
